//package org.jeecg.modules.activiti.listener;
//
//import org.activiti.engine.delegate.DelegateExecution;
//import org.activiti.engine.delegate.ExecutionListener;
//import org.jeecg.common.util.SpringContextUtils;
//import org.jeecg.modules.activiti.entity.ActBusiness;
//import org.jeecg.modules.activiti.service.Impl.ActBusinessServiceImpl;
//import org.jeecg.modules.zcgl.entity.AssetInfo;
//import org.jeecg.modules.zcgl.service.IAssetInfoService;
//import org.springframework.stereotype.Component;
//
///**
// * 资产生效审批后监听
// */
//@Component
//public class AssetTakeEffectListener implements ExecutionListener {
//
//    ActBusinessServiceImpl actBusinessService;
//    private IAssetInfoService assetInfoService;
//
//    public void notify(DelegateExecution execution) throws Exception {
//        if (assetInfoService == null){
//            assetInfoService = (IAssetInfoService)SpringContextUtils.getBean("assetInfoServiceImpl");
//        }
//        if (actBusinessService == null){
//            actBusinessService = (ActBusinessServiceImpl) SpringContextUtils.getBean("actBusinessServiceImpl");
//        }
//
//        String eventName = execution.getEventName();
//        //start
//        if (EVENTNAME_START.equals(eventName)) {
//
//        } else if (EVENTNAME_END.equals(eventName)) {
//            ActBusiness actBusiness = actBusinessService.getById(execution.getProcessBusinessKey());
//            if (actBusiness != null && "zcgl_asset_info".equalsIgnoreCase(actBusiness.getTableName())){
//                AssetInfo assetInfo = assetInfoService.getById(actBusiness.getTableId());
//                if (assetInfo != null){
//                    assetInfo.setStatus(assetInfo.getInitStatus());
//                    assetInfo.setProcessDescription("");
//                    assetInfo.setProcessStatus(-1);
//                    assetInfo.setProcessStatusText("");
//                    assetInfoService.updateById(assetInfo);
//                }
//            }
//        }
////        System.out.println("----" + execution.getProcessBusinessKey() + "" + execution.getProcessDefinitionId());
//    }
//}
